/* eslint-disable @typescript-eslint/no-unused-vars */

/******************** 常量 */

// tokenPath
export const TOKEN_PATH = "/oauth2/token";

// authorizePath
export const AUTHORIZE_PATH = "/oauth2/auth";

/******************** 未知环境变量-每次上线需要运维配置 */

// node端地址 保留
const STAND_NODE_DOMAIN = process.env.STAND_NODE_DOMAIN as string;

// 处理登录成功回调函数的地址 web端地址
export const CALLBACK_URL =
  ((process.env.STAND_WEB_DOMAIN as string) || "http://localhost") +
  "/#/login-callback";

// redis host
export const REDIS_HOST =
  (process.env.STAND_REDIS_HOST as string) ||
  "ec2-34-238-23-54.compute-1.amazonaws.com";

// redis port
export const REDIS_PORT = (process.env.STAND_REDIS_PORT as string) || 6380;

// redis password
export const REDIS_PASSWORD =
  (process.env.STAND_REDIS_PASSWORD as string) || "1q2w3e4r5t";

// 独立站grpc地址
export const GRPC_ADDRESS =
  (process.env.STAND_GRPC_ADDRESS as string) || "grpc.test.thierex.com:30032";

// 商品基建grpc地址
export const GRPC_ADDRESS_2 =
  (process.env.GOODS_GRPC_ADDRESS as string) || "grpc.test.thierex.com:30027";

// 三方授权grpc地址
export const GRPC_ADDRESS_3 =
  (process.env.AUTH_GRPC_ADDRESS as string) || "grpc.test.thierex.com:30023";

/******************** 已知环境变量-每次上线提供给运维 */

// 登录域名
// 测试环境: https://test-oauth2.zx-tech.net
// 正式环境: https://oauth2.mundossp.com
export const LOGIN_DOMAIN =
  (process.env.STAND_LOGIN_DOMAIN as string) ||
  "https://test-oauth2.zx-tech.net";

// 权限系统请求地址
// 测试环境: https://test-oauth2.zx-tech.net
// 正式环境: https://oauth2.mundossp.com
export const ROLE_ADDRESS =
  (process.env.ROLE_HTTP_ADDRESS as string) ||
  "https://test-oauth2.zx-tech.net";

// 应用id
// 测试环境: b72ee081-b0b3-48b5-301f-b7834c2a7a2d
// 正式环境: 4f4bf9a8-bcb7-6bc8-b9eb-bba347cd26bb
export const CLIENT_ID =
  (process.env.STAND_CLIENT_ID as string) ||
  "b72ee081-b0b3-48b5-301f-b7834c2a7a2d";
